home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / shells / scsh-0.4 / scsh-0 / scsh-0.4.2 / env / load-package.scm < prev    next >
Text File  |  1995-10-13  |  872b  |  27 lines

  1. ; Copyright (c) 1993, 1994 Richard Kelsey and Jonathan Rees.  See file COPYING.
  2.  
  3. ; Added really-ensure-loaded proc, which gives you noise control.
  4. ;     -Olin 6/95.
  5.  
  6. (define (ensure-loaded . structs)        ; S48 default is noisily.
  7.   (apply really-ensure-loaded
  8.      (current-output-port)    ; Should this be error port?
  9.      structs))
  10.  
  11. (define (really-ensure-loaded noise . structs)
  12.   (really-scan-structures structs noise
  13.               (lambda (p) (not (package-loaded? p)))
  14.     (lambda (stuff p)  ;stuff = pair (file . (node1 node2 ...))
  15.       (really-noting-undefined-variables p noise
  16.         (lambda ()
  17.       (with-interaction-environment p
  18.         (lambda ()
  19.           (for-each (lambda (filename+scanned-forms)
  20.               (really-eval-scanned-forms
  21.                   (cdr filename+scanned-forms)
  22.                   p
  23.                   (car filename+scanned-forms)
  24.                   noise))
  25.             stuff)
  26.           (set-package-loaded?! p #t))))))))
  27.